package com.theeviljames.sorting;

import java.util.ArrayList;
import java.util.Arrays;

public class SortTests {

	
	public static void runTests(){
		SelectionSort ss = new SelectionSort();
		InsertionSort is = new InsertionSort();
		ExchangeSort es = new ExchangeSort();
		MergeSort ms = new MergeSort();
		ArrayList<ISort> sortingStrategies = new ArrayList<ISort>();
		sortingStrategies.add(ss);
		sortingStrategies.add(is);
		sortingStrategies.add(es);
		sortingStrategies.add(ms);
		for(ISort i:sortingStrategies){
			int[] test1 = new int[]{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
			int[] test2 = new int[]{2,7,1,2,9,3,7,2,5,7,2,6,9,1,4,3,8,4,2,1};
			int[] test3 = new int[]{1652,15634,5169,5,7,3,8,1,764,6,5,42,2,6,2,4658,354,3,1,9754};
			System.out.println(test1.length + " " + test2.length + " " + test3.length);
			System.out.println("Testing " + i+"\n");
			System.out.println("Input 1 >" + Arrays.toString(test1));
			System.out.println("After sorting >" + Arrays.toString(i.sort(test1))+"\n");
			System.out.println("Input 2 >" + Arrays.toString(test2));
			System.out.println("After sorting >" + Arrays.toString(i.sort(test2))+"\n");
			System.out.println("Input 3 >" + Arrays.toString(test3));
			System.out.println("After sorting >" + Arrays.toString(i.sort(test3))+"\n");
		}
	}
	
	public static void main(String[] args) {
		runTests();
	}
}
